<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="renderer" content="webkit"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"/>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no"/>
	<title>网格</title>
	<!-- 基础css  -->
	<link rel="stylesheet" href="layui/css/layui.css" />
	<link rel="stylesheet" href="css/region.css" />
	<!-- 首页css  -->
</head>
<body>
	<div class="waTab">
		<div class="special-date">2017年11月13日星期一</div>
		<div class="float-window-add-special-event div_border show">
  <div class="event-summary">
  </div>
  <!--<h4>新增事件</h4>-->
  <!-- <p class="map_new_event_tit">新增上报</p> -->
  <div class="map_new_event_wrap event-reporting-style">
    <div class="event-reporting" style="border-right:none">
      <div class="event-reporting-png1 event-reporting-pngn1  event-reporting-png">
        <span>上报</span>
      </div>
      <form class="layui-form">
      	  <div class="layui-form-item">
		     <div class="layui-inline">
		      <label class="layui-form-label">时间</label>
		      <div class="layui-input-inline">
		        <input type="text" name="date" id="date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
		      </div>
		    </div>
		  </div>
		  
		  <div class="layui-form-item">
		    <div class="layui-inline">
		      <label class="layui-form-label">地点</label>
		      <div class="layui-input-inline">
		        <select name="modules" lay-verify="required" lay-search="">
		          <option value="">全部</option>
		          <option value="1">1</option>
		          <option value="2">2</option>
		        </select>
		      </div>
		    </div>
		    <div class="layui-inline">
		      <div class="layui-input-inline">
		        <select name="modules" lay-verify="required" lay-search="">
		          <option value="">楼栋</option>
		          <option value="1">1</option>
		          <option value="2">2</option>
		        </select>
		      </div>
		    </div>
		  </div>
		  
		  <div class="layui-form-item">
		    <label class="layui-form-label">当事人</label>
		    <div class="layui-input-block">
		      <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入学生姓名或学号，添加相关学生" class="layui-input">
		      <br/>
		      <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入学生姓名或学号，添加相关学生" class="layui-input">
		    </div>
		  </div>
		  
		  <div class="layui-form-item">
		    <div class="layui-inline">
		      <label class="layui-form-label">类型</label>
		      <div class="layui-input-inline">
		        <select name="modules" lay-verify="required" lay-search="">
		          <option value="">全部</option>
		          <option value="1">1</option>
		          <option value="2">2</option>
		        </select>
		      </div>
		    </div>
		  </div>
		  
		    <div class="layui-form-item layui-form-text">
			    <label class="layui-form-label">事件</label>
			    <div class="layui-input-block">
			      <textarea placeholder="请输入内容" class="layui-textarea"></textarea>
			    </div>
			</div>
		  	
		  	<div class="layui-form-item layui-form-text">
			    <label class="layui-form-label">图片</label>
			    <div class="layui-upload">
				  <button type="button" class="layui-btn" id="test1">上传图片</button>
				  <div class="layui-upload-list">
				    <img class="layui-upload-img" id="demo1">
				    <p id="demoText"></p>
				  </div>
				</div>   
			</div>
		  	
		  	<div class="layui-form-item">
			    <div class="layui-input-block">
			      <button class="layui-btn" lay-submit="" lay-filter="demo1">保存上传</button>
			      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
			    </div>
			</div>
      </form>
    </div>
    <div class="event-item event-processing">
      <div class="event-reporting-png2 event-reporting-png" style="top: -25px;">
        <span>处理</span>
      </div>
    </div>
    <div class="event-confirm event-processing">
      <div class="event-reporting-png3 event-reporting-png">
        <span>确认</span>
      </div>
    </div>
  </div>
  <!-- end .map_new_event_wrap -->
</div>
	</div>
	<script src="js/jquery-1.8.3.min.js"></script>
	<script src="layui/layui.js" charset="utf-8"></script>
    <script>
		layui.use(['form','upload','layedit', 'laydate'], function(){
		  var form = layui.form
		  ,layer = layui.layer
		  ,layedit = layui.layedit
		  ,laydate = layui.laydate
		  ,upload = layui.upload;
		   //日期
		  laydate.render({
		    elem: '#date'
		  });
		  //监听提交
		  form.on('submit(demo1)', function(data){
		    layer.alert(JSON.stringify(data.field), {
		      title: '最终的提交信息'
		    })
		    return false;
		  });
		  
		  //普通图片上传
		  var uploadInst = upload.render({
		    elem: '#test1'
		    ,url: '/upload/'
		    ,before: function(obj){
		      //预读本地文件示例，不支持ie8
		      obj.preview(function(index, file, result){
		        $('#demo1').attr('src', result); //图片链接（base64）
		      });
		    }
		    ,done: function(res){
		      //如果上传失败
		      if(res.code > 0){
		        return layer.msg('上传失败');
		      }
		      //上传成功
		    }
		    ,error: function(){
		      //演示失败状态，并实现重传
		      var demoText = $('#demoText');
		      demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
		      demoText.find('.demo-reload').on('click', function(){
		        uploadInst.upload();
		      });
		    }
		  });
		});
	</script>
</body>
</html>
